<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=7" />
    <title>图片上传及裁剪</title>
    <link rel="stylesheet" type="text/css" href="../example.css" />
<style>
#container {
  background : #EEF6FC;
  border-top : 1px solid #DBEBF1;
  padding : 10px;
}
</style>
</head>
<body>

<div id="doc4">
  <div class="hd">
    <div class="hd-title">image uploader & cropper example:</div>
  <div class="hd">
    <form>
    <div id="container">
    </div>
    </form>
  </div>
    <h1>code:</h1>
<pre>
更多API请参见：
<a href="../jsdoc/symbols/__.widget.ImgUploader.html">../jsdoc/symbols/__.widget.ImgUploader.html</a>
<a href="../jsdoc/symbols/__.widget.ImgCropper.html">../jsdoc/symbols/__.widget.ImgCropper.html</a>

单独的ImgCropper的例子请参见： <a href="../imgcropper/demo.html" target="_blank">../imgcropper/demo.html</a>

__.load(['imgcropper'], function() {
  var _ = __._;
  var oImgUploader = new __.widget.ImgUploader('container', {
    postUrl : './upload.html',
    maxImgCount : 6, // max number of images to upload
    cropConfig : {
      postUrl : './crop.html',
      onOk : function(cropObj) {
        alert(_.dump(cropObj));
      }
    }
  });
 //oImgUploader.addImages(); use add images to add image after initiate
});
</pre>
  </div>
</div>
<script>
__ = {
  cfg : [undefined, true, '0', 'http://localhost/att/workspace/os/svn']
};
</script>
<script src="http://localhost/att/workspace/os/svn/trunk/src/loader/loader.js"></script>
<script>
__.load(['yui core imguploader', 'imguploader_css'], function() {
  var _ = __._;

  /* begin:图片裁剪上传 */
  var oImgUploader = new __.widget.ImgUploader('container', {
    postUrl : './upload.html',
    maxImgCount : 6, // max number of images to upload
    cropConfig : {
      postUrl : './crop.html',
      onOk : function(cropObj) {
        alert(_.dump(cropObj));
      }
    }
  });
  var existingPic = "{\"data\":\"what the fuck\",\"url\":\"http://stauren.com/uploads/agirl.jpg\"}";
  existingPic = __._.fromJson(existingPic);
  oImgUploader.addImages([existingPic, existingPic, existingPic]);
  oImgUploader.addImages(existingPic);
  /* end:图片裁剪上传 */

});
</script>
</body>
</html>

